package com.face.service;

import com.face.entity.UpdateLog;
import com.face.mapper.UpdateLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ClassName: UpdateService <br/>
 * Description: <br/>
 * date: 2019/12/25 19:56<br/>
 *
 * @author geyee<br />
 */
@Service
public class UpdateService {

    @Autowired
    private UpdateLogMapper updateLogMapper;

    public UpdateLog checkUpdate(String version) {
        UpdateLog updateLog = updateLogMapper.selectLatest();
        if(updateLog != null) {
            if (!updateLog.getVersion().equals(version)) {
                return updateLog;
            }
        }
        return null;
    }
}
